using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;

namespace Chimera2.HUI
{
    public class CommandHandler
    {
        Main main;
        Hashtable cmds;

        public CommandHandler(Main main)
        {
            this.main = main;
            cmds = new Hashtable();
            cmds.Add("+list", Commands.List);
        }

        public string Process(string text, string UserName, Access access)
        {
            string command = text;
            string parameter = "";
            if (text.IndexOf(" ") > 0)
            {
                command = text.Substring(0, text.IndexOf(" "));
                parameter = text.Substring(text.IndexOf(" "));
            }

            if (cmds.ContainsKey(command))
            {
                switch ((Commands)cmds[command])
                {
                    case Commands.Help:
                        return CommandHelp(parameter, UserName, access);
                    case Commands.List:
                        break;
                    case Commands.Add:
                        break;
                    case Commands.Edit:
                        break;
                    case Commands.Delete:
                        break;
                    case Commands.Move:
                        break;
                    case Commands.Find:
                        break;
                    case Commands.Log:
                        break;
                    default:
                        break;
                }
            }
            
            return "";   
        }

        public enum Commands
        {
            Help, List, Add, Edit, Delete, Move, Find, Log
        }

        string CommandHelp(string parameter, string UserName, Access access)
        {
            return "";
        }
    }
}
